#ifndef HEXTOOLS_H_
#define HEXTOOLS_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C"
{
#endif


void hextools_char_to_hex(unsigned char src, unsigned char* out_hex16);
void hextools_get_str_from_chars(char* recvdata, uint16_t len, char* out_datas, uint16_t out_datas_max_len);

/// <summary>
/// 
/// </summary>
/// <param name="src">char[2] = ff | char[4] = 0xff</param>
/// <param name="out_hex16">char</param>
void hextools_hex_to_char(unsigned char *src, unsigned char *out_hex16);

/// <summary>
/// 每个字节 splitstr 分隔,hex16str 转 char[]
/// </summary>
/// <param name="hexstr"></param>
/// <param name="len"></param>
/// <param name="splitstr"></param>
/// <param name="out_datas"></param>
/// <param name="out_datas_max_len"></param>
/// <returns>返回char长度</returns>
uint32_t hextools_get_chars_from_hexstr(unsigned char* hexstr,uint32_t len, unsigned char splitstr , unsigned char* out_datas, uint32_t out_datas_max_len);

#ifdef __cplusplus
}
#endif

#endif // !HEXTOOLS_H_